<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>登录</title>
    <!-- Bootstrap core CSS -->
    <link th:href="@{/css/bootstrap.css}" href="css/bootstrap.css" rel="stylesheet">
    <link href="css/login.css" th:href="@{/css/login.css}" rel="stylesheet">
</head>

<body>
<div class="login">
    <h1><img src="images/gongfanglogo.png" th:src="@{/images/gongfanglogo.png}" alt="" width="80px"></h1>
    <form method="post" action="/movie/admin/login" id="loginFrom">
        <input class="username" type="text" name="username" placeholder="用户名" required="required" />
        <input class="password" type="password" name="password" placeholder="密码" required="required" />
    </form>
    <button type="submit" class=" btn btn-primary btn-block btn-large">登录</button>
</div>
<!-- 引入公共js文件 -->
<script th:src="@{/js/jquery-3.3.1.min.js}"></script>
<script src="js/bootstrap.js" th:src="@{/js/bootstrap.js}"></script>

<script>
    /**
     * 表单验证
     */
    $(".btn").on("click", function() {
        var user = $(".user").val();
        if (user == "") {
            $(".t-box").removeClass("dp-n");
            $(".t-color").html("用户名不能为空！");
            return;
        };
        var pwd = $(".pwd").val();
        if (pwd == "") {
            $(".t-box").removeClass("dp-n");
            $(".t-color").html("密码不能为空！");
            return;
        };

        $("#loginFrom").submit();
    });
</script>
</body>

</html>